package my.mall.db.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper
import my.mall.db.entity.Order
import org.apache.ibatis.annotations.Param

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author fengbo
 * @since 2024-04-19
 */
interface OrderMapper : BaseMapper<Order> {

    fun lockById(@Param("userId") userId: Long?, @Param("orderId") orderId: Long?): Order?

    fun updateStatus(
        @Param("orderId") orderId: Long?, @Param("newStatus") newStatus: Byte,
        @Param("oldStatus") oldStatus: Byte
    ): Int
}
